Optimal. Leaf size=38 \[ \frac{a^2 \tan ^3(c+d x)}{3 d}-\frac{a^2 \tan (c+d x)}{d}+a^2 x \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.0300588, antiderivative size = 38, normalized size of antiderivative = 1., number of steps used = 4, number of rules used = 3, integrand size = 15, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.2, Rules used = {4120, 3473, 8} \[ \frac{a^2 \tan ^3(c+d x)}{3 d}-\frac{a^2 \tan (c+d x)}{d}+a^2 x \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 4120
Rule 3473
Rule 8
Rubi steps
\begin{align*} \int \left (a-a \sec ^2(c+d x)\right )^2 \, dx &=a^2 \int \tan ^4(c+d x) \, dx\\ &=\frac{a^2 \tan ^3(c+d x)}{3 d}-a^2 \int \tan ^2(c+d x) \, dx\\ &=-\frac{a^2 \tan (c+d x)}{d}+\frac{a^2 \tan ^3(c+d x)}{3 d}+a^2 \int 1 \, dx\\ &=a^2 x-\frac{a^2 \tan (c+d x)}{d}+\frac{a^2 \tan ^3(c+d x)}{3 d}\\ \end{align*}
Mathematica [A] time = 0.0203196, size = 42, normalized size = 1.11 \[ a^2 \left (\frac{\tan ^3(c+d x)}{3 d}+\frac{\tan ^{-1}(\tan (c+d x))}{d}-\frac{\tan (c+d x)}{d}\right ) \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A] time = 0.024, size = 49, normalized size = 1.3 \begin{align*}{\frac{1}{d} \left ({a}^{2} \left ( dx+c \right ) -2\,{a}^{2}\tan \left ( dx+c \right ) -{a}^{2} \left ( -{\frac{2}{3}}-{\frac{ \left ( \sec \left ( dx+c \right ) \right ) ^{2}}{3}} \right ) \tan \left ( dx+c \right ) \right ) } \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A] time = 1.0022, size = 61, normalized size = 1.61 \begin{align*} a^{2} x + \frac{{\left (\tan \left (d x + c\right )^{3} + 3 \, \tan \left (d x + c\right )\right )} a^{2}}{3 \, d} - \frac{2 \, a^{2} \tan \left (d x + c\right )}{d} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A] time = 0.475513, size = 128, normalized size = 3.37 \begin{align*} \frac{3 \, a^{2} d x \cos \left (d x + c\right )^{3} -{\left (4 \, a^{2} \cos \left (d x + c\right )^{2} - a^{2}\right )} \sin \left (d x + c\right )}{3 \, d \cos \left (d x + c\right )^{3}} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F] time = 0., size = 0, normalized size = 0. \begin{align*} a^{2} \left (\int 1\, dx + \int - 2 \sec ^{2}{\left (c + d x \right )}\, dx + \int \sec ^{4}{\left (c + d x \right )}\, dx\right ) \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A] time = 1.27645, size = 53, normalized size = 1.39 \begin{align*} \frac{a^{2} \tan \left (d x + c\right )^{3} + 3 \,{\left (d x + c\right )} a^{2} - 3 \, a^{2} \tan \left (d x + c\right )}{3 \, d} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]